﻿@{ Layout = null;
  
}
@inject IDbServerService mService
@model DbServerEntity

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">服务器设置</h4>
</div>
<div class="modal-body">
    <div class="ibox float-e-margins">
        <div class="ibox-content text-center p-md">
            <form id="dynamic-DbServer-form" asp-action="DbServer" method="post" class="form-horizontal" role="form">
                <div asp-validation-summary="@ValidationSummary.All" class="text-danger"></div>
                <input type="hidden" asp-for="DbServerId" />
                <input type="hidden" asp-for="ParentId" />
                <div class="form-group">
                    <label asp-for="DbServerName" class="col-md-3 control-label text-right">数据库名称</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <input asp-for="DbServerName" class="form-control" validate="{required:true ,maxlength:50   }" />
                        </div>
                        <span asp-validation-for="DbServerName" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="LocalName" class="col-md-3 control-label text-right"> 别名</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <input asp-for="LocalName" class="form-control" validate="{required:true ,maxlength:50   }" />
                        </div>
                        <span asp-validation-for="LocalName" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="ProviderType" class="col-md-3 control-label text-right"> 类型</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <select class="select2" asp-for="ProviderType" validate="{required:true}">
                                @{
                                    var lst = ConvertHelper.ToEnumList(typeof(ProviderType), true);
                                    if (lst != null && lst.Count > 0)
                                    {
                                        foreach (var item in lst)
                                        {
                                            @Html.Raw("<option value='" + item.Key + "' " + (item.Key == Model.ProviderType ? "selected" : "") + ">" + item.Value + "</option>")
                                        }
                                    }
                                }
                            </select>
                        </div>
                        <span asp-validation-for="ProviderType" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="OrderNo" class="col-md-3 control-label text-right"> 排序</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <input asp-for="OrderNo" class="form-control" max="200" validate="{required:true ,number:true    }" />
                        </div>
                        <span asp-validation-for="OrderNo" class="text-danger"></span>
                    </div>
                </div>

                <div class="form-group">
                    <label asp-for="ConntionString" class="col-md-3 control-label text-right">连接字符串</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon">*</span>
                            <textarea asp-for="ConntionString" class="form-control" rows="3" validate="{required:true ,maxlength:500   }"></textarea>
                        </div>
                        <span asp-validation-for="ConntionString" class="text-danger"></span>
                    </div>
                </div>

               
                <div class="form-group">
                    <label asp-for="Remark" class="col-md-3 control-label text-right">描述</label>
                    <div class="col-md-9  text-left">
                        <div class="input-group m-b">
                            <span class="input-group-addon"></span>
                            <input asp-for="Remark" class="form-control" validate="{required:false ,maxlength:500   }" />
                        </div>
                        <span asp-validation-for="Remark" class="text-danger"></span>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>
<div class="modal-footer">

</div>
